package com.virus.mall.dao;

import com.virus.mall.model.*;
import com.virus.mall.model.vo.GoodsGetByTypeVo;
import com.virus.mall.model.vo.SearchGoodsVo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * @Classname GoodsDao
 * @Description NULL
 * @Date 2021/4/16 22:48
 * @Created by virus
 */
public interface GoodsDao {

    List<Type> getType();

    List<GoodsGetByTypeVo> getGoodsByType(Integer typeId);

    Integer addGoods(Goods goods);

    Integer addSpecList(ArrayList<Spec> specs);

    Integer deleteGoods(Integer id);

    Integer deleteSpecByGoodsId(Integer id);

    Integer addType(Type type);

    Integer deleteType(Integer id);

    List<Integer> selectGoodsIdByTypeId(Integer id);

    Integer deleteGoodsByTypeId(Integer id);

    Integer deleteSpecByIdList(List<Integer> goodsIdList);

    Goods getGoodsInfo(Integer id);

    Integer addSpec(Spec spec);

    Integer deleteSpec(Spec spec);

    Integer updateGoods(Goods goods);

    Integer updateSpec(ArrayList<Spec> specs);

    List<Reply> noReplyMsg();

    List<Reply> repliedMsg();

    Integer reply(Reply reply);

    List<Reply> getGoodsMsg(Integer id);

    Integer askGoodsMsg(Reply reply);

    String selectGoodsNameById(Integer id);

    List<SearchGoodsVo> searchGoods(String keyword);

    List<Comments> selectComments(Integer goodsId);

    Integer selectCountByGoodsId(Integer goodsId);

    Integer selectFullByGoodsId(Integer goodsId);

    Goods selectGoodsByGoodsDetailId(Integer goodsDetailId);

    Integer hasComment(Integer orderId);

    String selectSpecNameBySpecId(Integer goodsDetailId);

    Integer updateStockNumBySpecName(@Param("specName") String specName,@Param("goodsNum") Integer goodsNum,@Param("goodsId") Integer goodsId);

    Integer updateStockNumBySpecId(@Param("specId") Integer specId,@Param("goodsNum") Integer goodsNum);

    Integer selectStockNumBySpecName(@Param("specName") String specName, @Param("goodsId") Integer goodsId);

    Integer selectStockNumBySpecId(Integer specId);

    Integer judgeSpecDuplicate(@Param("goodsId") Integer goodsId,@Param("specName") String specName);
}
